package model

import (
	"gorm.io/gorm"
	"time"
)

type Subject struct {
	Id           uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	VideoId      uint           `gorm:"column:video_id;type:bigint(20) UNSIGNED;not null;" json:"video_id"`
	Title        string         `gorm:"column:title;type:varchar(50);comment:标题;not null;" json:"title"`               // 标题
	Introduction string         `gorm:"column:introduction;type:varchar(50);comment:简介;not null;" json:"introduction"` // 简介
	Course       string         `gorm:"column:course;type:varchar(50);comment:课程;not null;" json:"course"`             // 课程
	CreatedAt    time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt    time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt    gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (s *Subject) TableName() string {
	return "subject"
}
